package com.lankystar.logistucs.spring.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="company")
public class Company {

	private int companyId;
	private String companyName;
	private String introduce;
	private long createTime;
	private int remove;//0未删除、1删除
	private List<Truck> trucks; 
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getCompanyId() {
		return companyId;
	}
	public void setCompanyId(int companyId) {
		this.companyId = companyId;
	}
	public String getCompanyName() {
		return companyName;
	}
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	public String getIntroduce() {
		return introduce;
	}
	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}
	public long getCreateTime() {
		return createTime;
	}
	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}
	public int getRemove() {
		return remove;
	}
	public void setRemove(int remove) {
		this.remove = remove;
	}
	@OneToMany(mappedBy="company",cascade=CascadeType.ALL,fetch =FetchType.EAGER)
	public List<Truck> getTrucks() {
		return trucks;
	}
	public void setTrucks(List<Truck> trucks) {
		this.trucks = trucks;
	}
	
	
}
